<template>
  <div class="page">
    <div class="a" @click="jumpClick('b')">
      <div class="thumbnail">
        <img src="https://www.rrjiaoyi.com/app/games/jianren.png" alt="" style="width: 100%;margin-bottom: 1rem;">
        <h4>拆散贱人<br><h6>拆散贱人</h6></h4>
      </div>
    </div>
    <div class="a" @click="jumpClick('d')">
      <div class="thumbnail">
        <img src="https://www.rrjiaoyi.com/app/games/zuiqiangyanli.jpg" alt="" style="width: 100%;margin-bottom: 1rem;">
        <h4>最强眼力<br><h6>最强眼力</h6></h4>
      </div>
    </div>
  </div>
</template>
<style lang='scss'>
.page {
  background-color: #333;
  color: white;
  padding: 15rpx;
}
.a {
  margin: 30rpx 15rpx;
  text-decoration:none;
  // background-color: white;
  h4 {
    line-height: 40rpx;
    font-size: 16px;
    color: #333;
  }
  h6 {
    font-size: 12px;
    color: #777
  }
}
.thumbnail {
  color: black;
  display: block;
  padding: 20rpx;
  margin-bottom: 10rpx;
  // line-height: 1.42857143;
  background-color: #fff;
  border: 1px solid #ddd;
  border-radius: 4px
}
</style>
<script>
export default {
  components: {
  },
  data () {
    return {
      path: 'https://www.baidu.com/fm'
      // path: ''
    }
  },
  methods: {
    jumpClick(e) {
      // console.log(`/pages/web-view/main?path=${encodeURIComponent(art)}`)
      // window.sessionStorage.setItem('art', JSON.stringify({url: url, title: title}))
      // wx.setStorage({
      //   key: 'art',
      //   data: `${JSON.stringify({url: art, title: title})}`
      // })
      switch(e) 
      {
      case 'a':
        wx.navigateTo({
          url: `/pages/web-view/main?path=${encodeURIComponent('https://www.rrjiaoyi.com/flappy/')}`            
        })
        break;
      case 'b':
        wx.navigateTo({
          url: `/pages/web-view/main?path=${encodeURIComponent('https://www.rrjiaoyi.com/games/jianren/')}`            
        })
        break;
      case 'c':
        wx.navigateTo({
          url: `/pages/web-view/main?path=${encodeURIComponent('https://www.rrjiaoyi.com/games/plane/')}`            
        })
        break;
      case 'd':
        wx.navigateTo({
          url: `/pages/web-view/main?path=${encodeURIComponent('https://www.rrjiaoyi.com/games/zuiqiangyanli/')}`            
        })
        break;
      }
    }
  },
  created () {
  },
  mounted () {
    // this.path = decodeURIComponent(this.$root.$mp.query.path)
    // console.log(this.path)
  },
  onShareAppMessage () {
  return {
    // title: `${JSON.parse(wx.getStorageSync('art')).title}`,
    title: `关注公众号"无声或有声"-零用时间决定生活质量`,
    path: `/pages/news/main?sharepath=${encodeURIComponent(this.path)}`
  }
}
}
</script>
